package org.example.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.example.domain.esdomain.UserIndex;

import java.util.Date;

/**
 * 用户基本数据
 */
@Data
public class MineUserDateil {

    /**
     * 主键id
     */
    private Long id;

    /**
     * 用户头像
     */
    private String headImage;

    /**
     * 账号
     */
    private String account;

    /**
     * 名称
     */
    private String userName;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 电话号码
     */
    private String phone;

    /**
     * 电子邮箱
     */
    private String email;

    /**
     * 性别
     */
    private Integer sex;

    /**
     * 出生日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date birthday;

    /**
     * 家庭住址
     */
    private String address;

    /**
     * 详细地址
     */
    private String addressDetail;


    public MineUserDateil(UserIndex userIndex) {
        this.id = userIndex.getId();
        this.headImage = userIndex.getHeadImage();
        this.account = userIndex.getAccount();
        this.userName = userIndex.getUserName();
        this.nickName = userIndex.getNickName();
        this.phone = userIndex.getPhone();
        this.email = userIndex.getEmail();
        this.sex = userIndex.getSex();
        this.birthday = userIndex.getBirthday();
        this.address = userIndex.getAddress();
        this.addressDetail = userIndex.getAddressDetail();
    }
}
